cat >>/etc/zookeeper/zoo.conf
authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider
<<
zkCli.sh -server localhost:2181
addauth digest admin:admin_password

create /secure_node "secure_data" digest:admin:admin_password:cdrwa


get /secure_node



addauth digest admin:admin_password
get /secure_node



setAcl /secure_node digest:admin:admin_password:cdrwa,digest:user:user_password:rw



# 添加新用户的认证信息
addauth digest user:user_password

# 尝试读取节点数据
get /secure_node

# 尝试写入节点数据
set /secure_node "new_secure_data"
